package s05;

import base.Bean;
import net.sf.cglib.proxy.Enhancer;

/**
 * @author wangpp
 */
public class CallBackFilterTest {
    public static void main(String[] args) {
        MyCallBackHelper helper = new MyCallBackHelper(Bean.class);


        Enhancer e = new Enhancer();
        e.setSuperclass(Bean.class);
        e.setCallbackFilter(helper);
        e.setCallbacks(helper.getCallbacks());

        Bean b = (Bean) e.create();

        String aStr = b.test("hello");
        System.out.println(aStr);

        Integer aInt = b.test(1);
        System.out.println(aInt);

        Long aLong = b.test(1L);
        System.out.println(aLong);

        System.out.println(b.toString());
        System.out.println(b.hashCode());
        System.out.println(b.getClass());

    }
}
